package com.equis.architecture.service {
	
	import mx.messaging.ChannelSet;
	import mx.rpc.remoting.mxml.RemoteObject;
	
	public class ServiceLocator {
		
		private static function buildRemoteObject(serviceName:String):RemoteObject {
			var temp:RemoteObject = new RemoteObject();
			temp.destination = serviceName;
			temp.initialized(null, null);
			return temp;
		} 
		
		/**
		 * Returns a proxy of the desired sevice.
		 */
		public static function locate(serviceName:String):Service {
			return new Service(buildRemoteObject(serviceName));
		}
		
		public static function locateBlockingService(serviceName:String):Service {
			return new BlockingService(buildRemoteObject(serviceName));
		}
		
	}
}